gtk4.git
6 years agoglsl: use float literals
Elias Aebi [Sat, 6 Jul 2019 12:42:08 +0000 (14:42 +0200)]
glsl: use float literals

6 years agoMerge branch 'header-custom-title-valign' into 'master'
Timm Bäder [Thu, 4 Jul 2019 12:45:13 +0000 (12:45 +0000)]
Merge branch 'header-custom-title-valign' into 'master'

headerbar: Don't change the custom title's valign

See merge request GNOME/gtk!981

6 years agoheaderbar: Don't change the custom title's valign
Adrien Plazas [Thu, 4 Jul 2019 11:03:37 +0000 (13:03 +0200)]
headerbar: Don't change the custom title's valign

This allows custom titles to use the vertical alignment of their choice
without having to set it manually after it has been added to the header
bar, hence allowing them to define their preferred alignment from a UI
template.

This is useful for widgets like the view switcher which requires filling
the header bar's whole height.

6 years agoci: Comment job, not just the stage
Emmanuele Bassi [Wed, 3 Jul 2019 16:57:27 +0000 (17:57 +0100)]
ci: Comment job, not just the stage

GitLab doesn't like it when we keep a job but disable the stage.

6 years agoci: Disable deploy jobs
Emmanuele Bassi [Wed, 3 Jul 2019 16:54:32 +0000 (17:54 +0100)]
ci: Disable deploy jobs

The version of gtk-doc in our CI image is not new enough to cope with
the fact that GTK lost container properties.

6 years agoMerge branch 'wip/frame-clock-consumers' into 'master'
Benjamin Otte [Wed, 3 Jul 2019 16:21:32 +0000 (16:21 +0000)]
Merge branch 'wip/frame-clock-consumers' into 'master'

Frame clock consumers

See merge request GNOME/gtk!971

6 years agoMerge branch 'layout-manager-ref' into 'master'
Emmanuele Bassi [Wed, 3 Jul 2019 13:25:44 +0000 (13:25 +0000)]
Merge branch 'layout-manager-ref' into 'master'

widget: Don't lose a layout manager ref

See merge request GNOME/gtk!977

6 years agowidget: Don't lose a layout manager ref
Matthias Clasen [Wed, 3 Jul 2019 13:16:35 +0000 (13:16 +0000)]
widget: Don't lose a layout manager ref

gtk_widget_set_layout_manager is transfer-full,
so we must give it a new reference from set_property
to implement object property semantics properly.

6 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 3 Jul 2019 09:45:12 +0000 (11:45 +0200)]
Updated Spanish translation

6 years agogdksurface: Make all surfaces listen to the frame clock signals
Jonas Ådahl [Fri, 28 Jun 2019 18:54:16 +0000 (20:54 +0200)]
gdksurface: Make all surfaces listen to the frame clock signals

Instead of the toplevel driving popups, have the popups listen to the
frame clock themselves. Otherwise, if the toplevel for some reason isn't
drawn by the compositor and stops drawing new frames, popups wouldn't
get painted either.

6 years agogdk/frameclock: Make surfaces inhibit freeze
Jonas Ådahl [Fri, 28 Jun 2019 16:45:44 +0000 (18:45 +0200)]
gdk/frameclock: Make surfaces inhibit freeze

To make a frame clock tick as long as any of the associated surfaces
expect to receive ticks, make the surfaces inhibit freezing the clock,
instead of directly tell the frame clock to freeze itself.

This makes it so that as long as any surface using a certain frame clock
is not frozen (e.g. just received a frame event from the display
server), the frame clock will not be frozen.

With this, the frame clock is initiated as frozen, and won't be thawed
until any surface inhibits freeze. It will be frozen again, when every
surface has that previously inhibited freeze uninhibited freeze.

6 years agotests: Add back testpopupat
Jonas Ådahl [Tue, 25 Jun 2019 12:14:31 +0000 (14:14 +0200)]
tests: Add back testpopupat

It's still useful for testing menus. Fixed the .ui file by removing a
property that no longer exists.

This effectively reverts commit
84d2150077bbab60529ef8345f58247fee527364.

6 years agomenu: Remove unused variable
Jonas Ådahl [Mon, 24 Jun 2019 09:09:35 +0000 (11:09 +0200)]
menu: Remove unused variable

6 years agoconstraint: Fix property name typo in doc
Mohammed Sadiq [Wed, 3 Jul 2019 04:01:39 +0000 (09:31 +0530)]
constraint: Fix property name typo in doc

6 years agoUpdate POTFILES.in and POTFILES.skip
Piotr Drąg [Tue, 2 Jul 2019 17:02:36 +0000 (19:02 +0200)]
Update POTFILES.in and POTFILES.skip

6 years agoUpdated Slovenian translation
Matej Urbančič [Tue, 2 Jul 2019 16:51:55 +0000 (18:51 +0200)]
Updated Slovenian translation

6 years agoMerge branch 'constraint-list-model' into 'master'
Matthias Clasen [Tue, 2 Jul 2019 14:18:42 +0000 (14:18 +0000)]
Merge branch 'constraint-list-model' into 'master'

Constraint list models

See merge request GNOME/gtk!975

6 years agoconstraint editor: Implement loading
Matthias Clasen [Tue, 2 Jul 2019 11:41:32 +0000 (11:41 +0000)]
constraint editor: Implement loading

Allow to reread the ui builder files we write out.
Just barely.

6 years agoconstraints editor: Stop naming constraints
Matthias Clasen [Tue, 2 Jul 2019 04:35:16 +0000 (04:35 +0000)]
constraints editor: Stop naming constraints

We don't have a field for the name in ui files,
so stop naming constraints.

6 years agoconstraint editor: Implement saving
Matthias Clasen [Mon, 1 Jul 2019 18:39:36 +0000 (18:39 +0000)]
constraint editor: Implement saving

Save to a ui file.

6 years agoconstraint editor: Use name properties
Matthias Clasen [Tue, 2 Jul 2019 03:15:12 +0000 (03:15 +0000)]
constraint editor: Use name properties

6 years agoconstraint editor: Use the list models
Matthias Clasen [Tue, 2 Jul 2019 00:15:55 +0000 (20:15 -0400)]
constraint editor: Use the list models

Instead of handrolling our own list models,
use the ones provided by GtkConstraintLayout.

6 years agoconstraint layout: Provide list models
Matthias Clasen [Tue, 2 Jul 2019 00:14:26 +0000 (20:14 -0400)]
constraint layout: Provide list models

Provide list models for the constraints and guides,
so we can show them in the inspector, and use them
in e.g. the constraints editor.

6 years agoMerge branch 'wip/ebassi/constraint-layout' into 'master'
Matthias Clasen [Tue, 2 Jul 2019 14:01:01 +0000 (14:01 +0000)]
Merge branch 'wip/ebassi/constraint-layout' into 'master'

Add constraint-based layout manager

Closes #1090

See merge request GNOME/gtk!973

6 years agodocs: Add more private headers to the list
Emmanuele Bassi [Tue, 2 Jul 2019 08:48:17 +0000 (09:48 +0100)]
docs: Add more private headers to the list

The various GtkConstraint private API should not be scanned for
documentation.

6 years agodocs: Fix typo in function name
Emmanuele Bassi [Tue, 2 Jul 2019 08:44:48 +0000 (09:44 +0100)]
docs: Fix typo in function name

6 years agowidget-factory: Use correct StyleProvider priority
Daniel Boles [Mon, 1 Jul 2019 18:13:45 +0000 (19:13 +0100)]
widget-factory: Use correct StyleProvider priority

We are an application, not a user.

cherry-pick of !974

6 years agoMerge branch 'option-names' into 'master'
Matthias Clasen [Tue, 2 Jul 2019 01:28:43 +0000 (01:28 +0000)]
Merge branch 'option-names' into 'master'

meson: Rename documentation option to gtk_doc

See merge request GNOME/gtk!972

6 years agoflattenlistmodeL: Compute items-changed position properly
Benjamin Otte [Mon, 1 Jul 2019 23:57:20 +0000 (23:57 +0000)]
flattenlistmodeL: Compute items-changed position properly

The code previously forgot to include the left child of the model's
node. Which of course only happened if that child wasn't NULL, which is
a common case.

Found and test provided by Matthias Clasen.

6 years agomeson: Rename documentation option to gtk_doc
Matthias Clasen [Mon, 1 Jul 2019 16:57:16 +0000 (12:57 -0400)]
meson: Rename documentation option to gtk_doc

This name is what most of the stack is using.
Lets follow along, even though it is (imo)
uglier.

6 years agomeson: cups: use cups-config for looking up cups
Christoph Reiter [Mon, 1 Jul 2019 19:52:06 +0000 (21:52 +0200)]
meson: cups: use cups-config for looking up cups

We were looking for the cups headers and the cups lib in the default locations
which for example breaks with OpenBSD where the cups headers are under /usr/local/include/

Instead just use the "cups" dependency type from meson which internally uses cups-config.

See #1967

Ported to master from !963

6 years agobuild/cups: remove checks for httpGetAuthString and http_t.authstring
Christoph Reiter [Sat, 15 Jun 2019 07:42:17 +0000 (09:42 +0200)]
build/cups: remove checks for httpGetAuthString and http_t.authstring

httpGetAuthString() was added with cups 1.3 and we depend on a newer version
now. The direct field access was a fallback in case httpGetAuthString()
was missing, so this can also be dropped.

Ported to master from !938

6 years agoAdd custom parser for guides defined in GtkBuilder UI files
Emmanuele Bassi [Mon, 1 Jul 2019 18:22:48 +0000 (19:22 +0100)]
Add custom parser for guides defined in GtkBuilder UI files

Like we describe constraints, we can also define guides.

6 years agoImplement GtkBuildable for GtkConstraintLayout
Emmanuele Bassi [Mon, 1 Jul 2019 17:03:20 +0000 (18:03 +0100)]
Implement GtkBuildable for GtkConstraintLayout

Using GtkBuildable we can provide a custom parser for reading
constraints defined in a GtkBuilder UI file.

6 years agoUse the right GValue getter for GtkConstraintGuide:strength
Emmanuele Bassi [Mon, 1 Jul 2019 17:02:19 +0000 (18:02 +0100)]
Use the right GValue getter for GtkConstraintGuide:strength

The property is defined as an enum.

This fixes the defaultvalue and notify tests.

6 years agoUse explicit values for constraint strength
Emmanuele Bassi [Mon, 1 Jul 2019 11:39:24 +0000 (12:39 +0100)]
Use explicit values for constraint strength

Instead of playing games with mapping negative symbolic values to
positive ones, let's use the appropriate constants everywhere. This
allows us to use:

        GTK_CONSTRAINT_STRENGTH_WEAK * 2

Or

        GTK_CONSTRAINT_STRENGTH_STRONG + 1

In code using the public API.

We also store the strength values as integers, so we can compare them
properly, and only turn them into doubles when they are inserted into
the solver, just like every other variable.

6 years agoconstraint editor: Allow dragging children
Matthias Clasen [Mon, 1 Jul 2019 04:24:26 +0000 (04:24 +0000)]
constraint editor: Allow dragging children

We add a weak constraint for the position
and update it as the widget is dragged.

6 years agoDocumentation fixes
Matthias Clasen [Mon, 1 Jul 2019 03:17:58 +0000 (03:17 +0000)]
Documentation fixes

Make sure all types show up in the docs,
and misc other improvements.

6 years agoconstraint editor: Enable max size for guide
Matthias Clasen [Mon, 1 Jul 2019 02:23:39 +0000 (02:23 +0000)]
constraint editor: Enable max size for guide

Also, use the apis we have now, and make the
spin buttons display 'unset' values as such.

6 years agoconstraint layout: go back to keeping constraints
Matthias Clasen [Sat, 29 Jun 2019 04:17:46 +0000 (04:17 +0000)]
constraint layout: go back to keeping constraints

We want to minimize changes to the solver, so
keep the size constraints around and only update
them when the size changes.

6 years agoconstraint layout: Use stronger force for min size
Matthias Clasen [Sat, 29 Jun 2019 22:20:20 +0000 (22:20 +0000)]
constraint layout: Use stronger force for min size

We want our edit constraint to be strong enough to
overpower nat. size constraint, therefore use STRONG * 2.

6 years agoFix warnings from the introspection scanner
Emmanuele Bassi [Mon, 1 Jul 2019 00:13:00 +0000 (01:13 +0100)]
Fix warnings from the introspection scanner

The name of the arguments of the functions must match the name of the
arguments in the documentation stanza.

6 years agoAdd gtkconstraintguide.h to the public headers
Emmanuele Bassi [Mon, 1 Jul 2019 00:12:25 +0000 (01:12 +0100)]
Add gtkconstraintguide.h to the public headers

It needs to be introspected and installed.

6 years agoRemove specialised API from GtkConstraint
Emmanuele Bassi [Mon, 1 Jul 2019 00:05:04 +0000 (01:05 +0100)]
Remove specialised API from GtkConstraint

Thet widget-based API for constraint target and source properties is
unused, and not really necessary.

6 years agoAdd missing documentation for GtkConstraint
Emmanuele Bassi [Mon, 1 Jul 2019 00:02:56 +0000 (01:02 +0100)]
Add missing documentation for GtkConstraint

6 years agodocs: Add GtkConstraint and friends to the API reference
Emmanuele Bassi [Sun, 30 Jun 2019 23:49:20 +0000 (00:49 +0100)]
docs: Add GtkConstraint and friends to the API reference

6 years agoDocument GtkConstraintGuide
Emmanuele Bassi [Sun, 30 Jun 2019 23:48:59 +0000 (00:48 +0100)]
Document GtkConstraintGuide

6 years agoMove the VFL error domain to a public header
Emmanuele Bassi [Sun, 30 Jun 2019 23:47:44 +0000 (00:47 +0100)]
Move the VFL error domain to a public header

Since the public API will use it to fill out GErrors, it needs to be
publicly available.

6 years agoMerge branch 'gbsneto/fix-popover-dark-theme' into 'master'
Matthias Clasen [Sun, 30 Jun 2019 23:17:40 +0000 (23:17 +0000)]
Merge branch 'gbsneto/fix-popover-dark-theme' into 'master'

Fix GtkPopoverMenu in dark theme

See merge request GNOME/gtk!970

6 years agoAdd a constraint editor demo
Matthias Clasen [Sun, 30 Jun 2019 13:25:30 +0000 (13:25 +0000)]
Add a constraint editor demo

This is an initial cut at providing a tool
for interactive exploration of constraints.

6 years agoconstraint layout: Notice when guides change
Emmanuele Bassi [Sun, 30 Jun 2019 22:59:04 +0000 (23:59 +0100)]
constraint layout: Notice when guides change

We need to queue a resize here.

6 years agoMark the layout as changed
Matthias Clasen [Sat, 29 Jun 2019 22:51:28 +0000 (22:51 +0000)]
Mark the layout as changed

We should mark the layout as changed when
constraints are added or removed.

6 years agoconstraint guide: Avoid redundant constraints
Matthias Clasen [Sat, 29 Jun 2019 22:14:29 +0000 (22:14 +0000)]
constraint guide: Avoid redundant constraints

There is no point in creating a stay for nat
size when min == max. And no point in a constraint
for <= G_MAXINT either.

6 years agoconstraint guide: Fix initial property values
Matthias Clasen [Sat, 29 Jun 2019 22:13:41 +0000 (22:13 +0000)]
constraint guide: Fix initial property values

This was overlooked when the max-width/max-height/
strength properties were added.

6 years agoconstraint solver: Use GTK_NOTE
Matthias Clasen [Sat, 29 Jun 2019 20:40:34 +0000 (20:40 +0000)]
constraint solver: Use GTK_NOTE

Allow using GTK_DEBUG=constraints to get debug
output from the constraints solver.

6 years agosolver: Add private statistics api
Matthias Clasen [Sat, 29 Jun 2019 17:38:36 +0000 (17:38 +0000)]
solver: Add private statistics api

No point in keeping these counters without
a way to show them.

6 years agoconstraint layout: Dont reset constraints in allocate
Matthias Clasen [Sat, 29 Jun 2019 17:36:47 +0000 (17:36 +0000)]
constraint layout: Dont reset constraints in allocate

If trust our allocation algorithm, this can never
trigger (and in fact, it never does).

6 years agoconstraints: Add some internal apis
Matthias Clasen [Sat, 29 Jun 2019 14:21:58 +0000 (14:21 +0000)]
constraints: Add some internal apis

Checking if a set is empty or a singleton can
be done more efficiently than determining its size.

6 years agoconstraint guide: Make strength tweakable
Matthias Clasen [Sat, 29 Jun 2019 14:18:23 +0000 (14:18 +0000)]
constraint guide: Make strength tweakable

The strength for the natural width can be used
as a tie-breaker to make instable systems behave
in a more predictable way. This can be seen
in the simple constraints demo in gtk-demo.

6 years agoconstraints demo: Update comments
Matthias Clasen [Sat, 29 Jun 2019 14:15:42 +0000 (10:15 -0400)]
constraints demo: Update comments

6 years agoconstraint layout: freeze/thaw on mass ops
Matthias Clasen [Sat, 29 Jun 2019 05:06:56 +0000 (05:06 +0000)]
constraint layout: freeze/thaw on mass ops

In measure and allocate we are potentially
changing quite a few constraints. Don't
optimize at every step.

6 years agoconstraints: Use better data structures
Matthias Clasen [Sat, 29 Jun 2019 04:59:49 +0000 (04:59 +0000)]
constraints: Use better data structures

Use a GSequence for GtkVariableSet, to avoid
quadratic behavior.

6 years agoconstraint layout: Measure min/nat size separately
Matthias Clasen [Fri, 28 Jun 2019 23:00:34 +0000 (23:00 +0000)]
constraint layout: Measure min/nat size separately

Only constraint the opposite direction if we
actually have a for_size, and measure natural
size after removing the edit constraints. With
these changes, the test that compares constraint
layout to grid layout passes.

6 years agoconstraint layout: Use stays for natural size
Matthias Clasen [Fri, 28 Jun 2019 22:59:38 +0000 (22:59 +0000)]
constraint layout: Use stays for natural size

It makes more sense to treat the natural size
of both children and guides as stays, since
we want to meet these values as closely as we
can, under the circumstances.

6 years agoconstraint layout: Add debug output for guides
Matthias Clasen [Fri, 28 Jun 2019 22:55:39 +0000 (22:55 +0000)]
constraint layout: Add debug output for guides

Print out the allocation we end up giving to
guides. This helps in making sense of the
allocations of the child widgets that these
guides relate to.

6 years agoconstraints demo: Give space a name
Matthias Clasen [Fri, 28 Jun 2019 22:54:28 +0000 (22:54 +0000)]
constraints demo: Give space a name

Lets call it 'space'.

6 years agoconstraint guide: Add a name property
Matthias Clasen [Fri, 28 Jun 2019 22:53:43 +0000 (22:53 +0000)]
constraint guide: Add a name property

We need to be able to print meaningful debug messages
regarding these objects, and eventually present them
in the inspector too.

6 years agoconstraint guide: Shorten names
Matthias Clasen [Fri, 28 Jun 2019 22:38:56 +0000 (22:38 +0000)]
constraint guide: Shorten names

Now that this is its own source file,
no need for these prefixes anymore.

6 years agoconstraint layout: Measure more correctly
Matthias Clasen [Fri, 28 Jun 2019 20:55:13 +0000 (20:55 +0000)]
constraint layout: Measure more correctly

Set up all constraints for minimum + natural
width + height when measuring, regardless
of the orientation we're measuring. Anything
else will lead to incorrect answers when
there are constraints that cut across
dimensions.

6 years agosolver: Fix a copy/paste error
Matthias Clasen [Fri, 28 Jun 2019 19:51:37 +0000 (15:51 -0400)]
solver: Fix a copy/paste error

6 years agoconstraint solver: Fix repeat suggestions
Matthias Clasen [Fri, 28 Jun 2019 16:59:39 +0000 (16:59 +0000)]
constraint solver: Fix repeat suggestions

We were not storing the previous value, causing
the first two suggestions to work, but not later
ones.

Fixes the test added in the previous commit.

6 years agoAmend a constraint solver test
Matthias Clasen [Fri, 28 Jun 2019 16:30:07 +0000 (16:30 +0000)]
Amend a constraint solver test

Make the 'repeat edit' test make more than to
suggestions in a single edit phase. It turns out
that this does not work, whereas just doing
two in a row does.

6 years agodemo: Use constraint guide api
Matthias Clasen [Thu, 27 Jun 2019 22:06:53 +0000 (22:06 +0000)]
demo: Use constraint guide api

Use proper api to create and set up
the guide, and also try max-width.

6 years agoFlesh out GtkConstraintGuide
Matthias Clasen [Thu, 27 Jun 2019 19:25:04 +0000 (19:25 +0000)]
Flesh out GtkConstraintGuide

This commit moves GtkConstraintGuide into its own
source files to avoid gtkconstraintlayout.c turning
too messy, adds max size properties and implements
getters and setters.

6 years agoDrop an indirection
Matthias Clasen [Thu, 27 Jun 2019 19:32:56 +0000 (19:32 +0000)]
Drop an indirection

This struct is not really useful for just
a single hash table, and it gets in the way
of moving the guide code to its own file.

6 years agoDetach guides on unroot
Matthias Clasen [Thu, 27 Jun 2019 18:49:54 +0000 (18:49 +0000)]
Detach guides on unroot

We don't want to leave constraints behind.

6 years agoSimplify the guide implementation
Matthias Clasen [Thu, 27 Jun 2019 18:40:15 +0000 (18:40 +0000)]
Simplify the guide implementation

Store the values and constraints in
arrays, to facilitate treating them
uniformly.

6 years agoReturn the list of constraints added via VFL description
Emmanuele Bassi [Sun, 30 Jun 2019 09:36:33 +0000 (10:36 +0100)]
Return the list of constraints added via VFL description

Otherwise it's impossible to remove them.

6 years agoAdd method to remove all constraints from a layout
Emmanuele Bassi [Sun, 30 Jun 2019 09:30:02 +0000 (10:30 +0100)]
Add method to remove all constraints from a layout

6 years agoAdwaita: Also apply $color_menu to popover arrows
Georges Basile Stavracas Neto [Sun, 30 Jun 2019 22:51:51 +0000 (19:51 -0300)]
Adwaita: Also apply $color_menu to popover arrows

So that popovers and arrows are always in agreement of
the background color.

6 years agoAdwaita: Use $menu_color background in popover.menu
Georges Basile Stavracas Neto [Sun, 30 Jun 2019 22:47:32 +0000 (19:47 -0300)]
Adwaita: Use $menu_color background in popover.menu

GtkPopoverMenus should mimic menus. Commit d936967b7a8 introduced
some CSS related to menu popovers, however, it hardcodes 'white'
as the background color. That is problematic for the dark theme.

Use '$menu_color' instead of 'white', since $menu_color both
guarantees menu popovers and menus match, and already handles
different colors for dark and light theme variants.

6 years agoAdd a C convenience function for VFL constraints
Emmanuele Bassi [Sat, 29 Jun 2019 18:04:29 +0000 (19:04 +0100)]
Add a C convenience function for VFL constraints

The dictionary-based function is convenient for language bindings, but C
developers will feel more at home with a variadic arguments list.

6 years agoAdd Constraints/VFL demo
Emmanuele Bassi [Sat, 29 Jun 2019 17:50:55 +0000 (18:50 +0100)]
Add Constraints/VFL demo

Shows how to describe constraints using VFL instead of constructing
objects manually.

6 years agoAllow adding constraints described through VFL
Emmanuele Bassi [Sat, 29 Jun 2019 17:32:56 +0000 (18:32 +0100)]
Allow adding constraints described through VFL

6 years agoAdd VFL parser for constraints
Emmanuele Bassi [Sat, 29 Jun 2019 17:03:42 +0000 (18:03 +0100)]
Add VFL parser for constraints

Constraints can be expressed with a compact syntax, called VFL (visual
format language).

6 years agoRemove GtkConstraintVariable.set_prefix()
Emmanuele Bassi [Sat, 29 Jun 2019 16:21:55 +0000 (17:21 +0100)]
Remove GtkConstraintVariable.set_prefix()

The prefix and name are set at construction time.

6 years agoAdd an interactive constraints demo
Matthias Clasen [Wed, 26 Jun 2019 03:35:10 +0000 (03:35 +0000)]
Add an interactive constraints demo

6 years agoMake the constraints demo more interesting
Matthias Clasen [Wed, 26 Jun 2019 02:35:15 +0000 (02:35 +0000)]
Make the constraints demo more interesting

Add a max size to the buttons, to force the
space to open up.

6 years agoAdd GtkConstraintGuide
Matthias Clasen [Tue, 25 Jun 2019 23:38:32 +0000 (19:38 -0400)]
Add GtkConstraintGuide

This is meant to be a flexible space.

6 years agoUse generic pointers for constraint targets
Emmanuele Bassi [Thu, 27 Jun 2019 17:26:19 +0000 (18:26 +0100)]
Use generic pointers for constraint targets

Since GtkWidget implements GtkConstraintTarget, we can omit the explicit
cast, and validate the type at run time.

6 years agoRedefine constraints with GtkConstraintTarget
Matthias Clasen [Tue, 25 Jun 2019 19:16:02 +0000 (15:16 -0400)]
Redefine constraints with GtkConstraintTarget

This is in preparation for allowing non-widgets
to act as constraint targets.

6 years agowidget: Implement GtkConstraintTarget
Matthias Clasen [Tue, 25 Jun 2019 19:05:29 +0000 (19:05 +0000)]
widget: Implement GtkConstraintTarget

6 years agoAdd GtkConstraintTarget
Matthias Clasen [Tue, 25 Jun 2019 19:04:05 +0000 (15:04 -0400)]
Add GtkConstraintTarget

This is an marker interface that we will
use to accept other things that widgets
in constraints.

6 years agoNotify a layout change when adding and removing constraints
Emmanuele Bassi [Thu, 27 Jun 2019 16:37:09 +0000 (17:37 +0100)]
Notify a layout change when adding and removing constraints

Changing the set of constraints should cause a relayout.

6 years agoFix the opposite size measurement in GtkConstraintLayout
Emmanuele Bassi [Thu, 27 Jun 2019 16:34:29 +0000 (17:34 +0100)]
Fix the opposite size measurement in GtkConstraintLayout

We cannot use the given "for size" when querying our children, because
the constraint layout has no idea about the opposite size of its
children until the layout is complete.

Additionally, we should only suggest an opposite size for the layout if
we have one, instead of suggesting a weak zero size.

6 years agoRemove size constraints from ConstraintLayoutChild
Emmanuele Bassi [Thu, 27 Jun 2019 16:08:48 +0000 (17:08 +0100)]
Remove size constraints from ConstraintLayoutChild

The size constraints are transient to measurement and allocation, so
they don't really need to be stored inside the GtkLayoutChild subclass
created by a GtkConstraintLayout.

6 years agoconstraints: Make internal consistency required
Matthias Clasen [Wed, 26 Jun 2019 02:30:31 +0000 (02:30 +0000)]
constraints: Make internal consistency required

The relations between left, right, width
and top, bottom, height are required for
internal consistency. It doesn't make sense
to ever drop these.

Changing the strength of these relations makes
my systems behave much more stable.

6 years agoAdd gtk_constraint_layout_remove_constraint
Matthias Clasen [Wed, 26 Jun 2019 03:40:03 +0000 (03:40 +0000)]
Add gtk_constraint_layout_remove_constraint

Otherwise, you can't do many interesting things.

6 years agoDo not release reference on the subject of an expression
Emmanuele Bassi [Thu, 27 Jun 2019 15:42:58 +0000 (16:42 +0100)]
Do not release reference on the subject of an expression

We don't own the reference in the first place.

6 years agoconstraints solver: Avoid critials
Matthias Clasen [Thu, 27 Jun 2019 01:43:47 +0000 (01:43 +0000)]
constraints solver: Avoid critials

When the solver is finalized with existing
constraints, we end up with criticals when
the constraints ref finalize code calls
back into the hash table. Avoid that by
emptying the hash table beforehand.